package com.study.parse;

import io.milvus.grpc.FieldData;
import org.springframework.stereotype.Component;

import java.lang.reflect.Field;

@Component
public class StringParseResolver extends AbstractParseResolver {

    @Override
    public boolean isSupport(Field field) {
        return field.getType().getTypeName().equals("java.lang.String");
    }

    @Override
    public <T> void resolveParamBind(T ins, Field field, FieldData fieldData, int index) throws IllegalAccessException {
        field.set(ins, fieldData.getScalars().getStringData().getData(index));
    }
}
